import vue from '@vitejs/plugin-vue'

import createAutoImport from './auto-import'
import createCompression from './compression'
import createSetupExtend from './setup-extend'
import { createStyleImportPlugin, VxeTableResolve } from 'vite-plugin-style-import'
import basicSSL from "@vitejs/plugin-basic-ssl";

export default function createVitePlugins(viteEnv, isBuild = false) {
  const vitePlugins = []
  vitePlugins.push(createAutoImport())
  vitePlugins.push(createSetupExtend())
  vitePlugins.push(basicSSL())
  isBuild && vitePlugins.push(...createCompression(viteEnv))

  vitePlugins.push(createStyleImportPlugin({
    resolves: [VxeTableResolve()]
  }))
  return vitePlugins
}
